﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ISerializer.cs" company="Scrum for Team System">
//   None
// </copyright>
// <summary>
//   Defines the ISerializer type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace ScrumForTeamSystem.EventService.Infrastructure.Interfaces
{
    /// <summary>
    /// Defines the serializer interface
    /// </summary>
    /// <typeparam name="T">The type to serialise</typeparam>
    public interface ISerializer<T> where T : new()
    {
        /// <summary>
        /// Deserializes the specified source XML.
        /// </summary>
        /// <param name="sourceXml">The source xml.</param>
        /// <returns>The instance of the type specifed</returns>
        T Deserialize(string sourceXml);

        /// <summary>
        /// Serializes the specified source object.
        /// </summary>
        /// <param name="sourceObject">The source object.</param>
        /// <returns>The serialised representation of the source object.</returns>
        string Serialize(T sourceObject);
    }
}